<table id="datagrid_${action_id}" ></table>
<div id="datagrid_tb_${action_id}" style="padding:5px;height:auto">
</div>
<script type="text/javascript">

$(function(){
	
	$('#datagrid_tb_${action_id}').searcher({
		doSearch:function(qp){
			$('#datagrid_${action_id}').datagrid('options').queryParams = qp;
			$('#datagrid_${action_id}').datagrid('reload');
		}
	});
	
	$('#datagrid_${action_id}').datagrid({
		iconCls:'icon-save',
		width:'auto',
		height:'auto',
		nowrap: false,
		fit:true,
		fitColumns:true,
		striped: true,
		url:'${request.contextPath}${namespace?default('')}/page/moduleLinkType-datagrid.json',
		sortName: 'site',
		sortOrder: 'asc',
		remoteSort: true,
		singleSelect : true,
		queryParams:{moduleId:'${moduleId?default('')}'},
		idField:'id',
		singleSelect : ${cb?string('false','true')},
		onBeforeLoad:function(){$('#datagrid_${action_id}').datagrid('unselectAll');},
		columns:[[
					{field:'id',title:'${action.getDatagridTitle('id')}',width:80,align:'center',sortable:false},
					{field:'description',title:'${action.getDatagridTitle('description')}',width:80,align:'center',sortable:false},
					{field:'type',title:'${action.getDatagridTitle('type')}',width:80,align:'center',sortable:false,formatter:function(val,rec){
						<#list types as t>
						if(${t.type}==val){
							return '${action.getDatagridTitle('type.'+t.name())}';
						}
						</#list>
					}},
					{field:'site',title:'${action.getDatagridTitle('site')}',width:80,align:'center',sortable:false}
				]],
		pagination:true,
		rownumbers:true,
		toolbar:'#datagrid_tb_${action_id}',
		onDblClickRow:function(idx,data){if(typeof onDblClickRow_${action_id} != 'undefined'){onDblClickRow_${action_id}(idx,data)}},
		onClickRow:function(idx,data){if(typeof onClickRow_${action_id} != 'undefined'){onClickRow_${action_id}(idx,data)}},
		onRowContextMenu:function(e,idx,data){if(typeof onRowContextMenu_${action_id} != 'undefined'){$(this).datagrid('selectRow', idx);onRowContextMenu_${action_id}(e,idx,data)}}
	});

});


</script>	
